package com.qrgenerator.src;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;

import org.json.simple.JSONObject;

public class ProductCreator {

	long id = 0;
	String text;
	Double price;

	public ProductCreator(long id, String text, Double price) {
		super();
		this.id = id;
		this.text = text;
		this.price = price;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public String toString() {
		JSONObject obj = new JSONObject();
		
		Map m1 = new LinkedHashMap();
		m1.put("id", this.id);
		m1.put("text", this.text);
		m1.put("price",this.price);

		LinkedList  l1 = new LinkedList();
		l1.add(m1);
		
		obj.put("item", l1);
		return obj.toString();
	}

}
